package com.zprmb.udzt.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.zprmb.udzt.BaseActivity;
import com.zprmb.udzt.MainActivity;
import com.zprmb.udzt.MainActivity2;
import com.zprmb.udzt.R;

/**
 * @author shenshao
 */

public class FailActivity extends BaseActivity implements View.OnClickListener {


    TextView tv_title;

    //返回按钮
    ImageView img_back;

    TextView text_fail;
    //查看投资记录

    Button btn_jilu;
    //投资按钮

    Button btn_invest;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fail);
        tv_title = (TextView) findViewById(R.id.tv_title);
        tv_title.setText("投资结果");

        img_back = (ImageView) findViewById(R.id.img_back);
        img_back.setOnClickListener(this);
        text_fail= (TextView) findViewById(R.id.text_fail);
        text_fail.setText("失败原因:"+getIntent().getStringExtra("comment"));
        //查看投资记录
        btn_jilu= (Button) findViewById(R.id.btn_jilu);
        btn_jilu.setOnClickListener(this);
        btn_invest= (Button) findViewById(R.id.btn_invest);
        btn_invest.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.img_back:
                finish();
                break;
            case R.id.btn_jilu:

               /* Intent intent = new Intent(FailActivity.this, V6WebviewChild_SuccessYue.class);
                //智投宝
//                intent.putExtra("url", Constant.URL + "h5/currentDetail?&app=true&appversion=true&token=");
                intent.putExtra("url", Constant.URL + "h5/myNewInvest?&app=true&appversion=true&token=");
                startActivity(intent);
                finish();*/
                try {
                    MainActivity.newInstance().setCurrentTabByTag("tab_tag_zhanghu");
                }catch (Exception e){

                }
                try {
                    MainActivity2.newInstance().setCurrentTabByTag("tab_tag_zhanghu");
                }catch (Exception e){

                }


//                MainActivity.newInstance().setCurrentTabByTag("tab_tag_zhanghu");
                FailActivity.this.finish();
                break;
            case R.id.btn_invest:
                try {
                    MainActivity.newInstance().setCurrentTabByTag("tab_tag_liebiao");
                }catch (Exception e){

                }
                try {
                    MainActivity2.newInstance().setCurrentTabByTag("tab_tag_liebiao");
                }catch (Exception e){

                }
//                MainActivity.newInstance().setCurrentTabByTag("tab_tag_liebiao");
                FailActivity.this.finish();
                break;
        }
    }
}
